package android.slc.module.component.dict.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * 实体类
 *
 * @author Chill
 */
public class TreeDict implements ITreeDict<TreeDict> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private String id;

    /**
     * 父主键
     */
    private String parentId;

    /**
     * 字典码
     */
    private String code;

    /**
     * 字典值
     */
    private String dictKey;

    /**
     * 字典名称
     */
    private String dictValue;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 字典备注
     */
    private String remark;

    /**
     * 是否已封存
     */
    private Integer isSealed;

    /**
     * 是否已删除
     */
    private Integer isDeleted;

    private List<TreeDict> children;

    /**
     * 上级字典
     */
    private String parentName;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDictKey() {
        return dictKey;
    }

    public void setDictKey(String dictKey) {
        this.dictKey = dictKey;
    }

    public String getDictValue() {
        return dictValue;
    }

    public void setDictValue(String dictValue) {
        this.dictValue = dictValue;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getIsSealed() {
        return isSealed;
    }

    public void setIsSealed(Integer isSealed) {
        this.isSealed = isSealed;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public List<TreeDict> getChildren() {
        return children;
    }

    public void setChildren(List<TreeDict> children) {
        this.children = children;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    @Override
    public String getTdId() {
        return getId();
    }

    @Override
    public String getTdParentId() {
        return getParentId();
    }

    @Override
    public String getTdCode() {
        return getCode();
    }

    @Override
    public String getTdDictValue() {
        return getDictKey();
    }

    @Override
    public String getTdDictLabel() {
        return getDictValue();
    }

    @Override
    public List<TreeDict> getTdChildren() {
        if(getChildren()==null){
            new ArrayList<>();
        }
        return getChildren();
    }

    @Override
    public String getTdParentName() {
        return ITreeDict.super.getTdParentName();
    }
}
